<?php

namespace plugin\admin\app\model;

use DateTimeInterface;
use support\Model;


class Base extends Model
{
    const LANGUAGE_TEXT = [
        'zh' => '中文',
        'en' => '英文',
        'ja' => '日文',
        'ko' => '韩文',
        'ru' => '俄文',
        'de' => '德文',
        'fr' => '法文'
    ];

    public static function getLanguageText($language)
    {
        return self::LANGUAGE_TEXT[$language] ?? '';
    }

    /**
     * @var string
     */
//    protected $connection = 'plugin.admin.mysql';

    /**
     * 格式化日期
     *
     * @param DateTimeInterface $date
     * @return string
     */
    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format('Y-m-d H:i:s');
    }
}
